package com.xbongbong.workflow.service.operator;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.workflow.domain.entity.WorkflowNodeEntity;
import com.xbongbong.paas.pojo.workflow.WorkflowDataPojo;
import com.xbongbong.paas.pojo.workflow.WorkflowExplainPojo;
import com.xbongbong.workflow.pojo.WorkflowOperationsPojo;
import com.xbongbong.workflow.pojo.WorkflowTransferPOJO;
import com.xbongbong.workflow.pojo.nodes.InsertRecordNode;

import java.util.Map;

/**
 * @author 吴峰
 * @date 2021/06/24 9:43
 */
public interface WorkflowOperatorMainAndSubFormService<T> {



    /**
     * 基于多条记录新增
     * @param workflowOperationsPojo
     * @param workflowExplainPojo
     * @param targetField
     * @param formDataMap
     * @param dataMap
     * @param insertRecordNode
     * @param workflowNodeEntity
     * @param workflowDataPojo
     * @param workflowTransferPojo
     * @return
     * @throws XbbException
     */

    T getInsertFieldListByDataNode(WorkflowOperationsPojo workflowOperationsPojo, WorkflowExplainPojo workflowExplainPojo,
                                   FieldAttrEntity targetField, Map<Long, PaasFormDataEntityExt> formDataMap , Map<Long, JSONObject> dataMap, InsertRecordNode insertRecordNode,
                                   WorkflowNodeEntity workflowNodeEntity, WorkflowDataPojo workflowDataPojo, WorkflowTransferPOJO workflowTransferPojo) throws XbbException;

    /**
     * 获取更新实体
     * @param workflowOperationsPojo
     * @param workflowExplainPojo
     * @param targetField
     * @param formDataMap
     * @param dataMap
     * @param workflowNodeEntity
     * @param workflowDataPojo
     * @param workflowTransferPojo
     * @return
     * @throws XbbException
     */
    Object getUpdateData(WorkflowOperationsPojo workflowOperationsPojo, WorkflowExplainPojo workflowExplainPojo,
                                   FieldAttrEntity targetField, Map<Long, PaasFormDataEntityExt> formDataMap, Map<Long, JSONObject> dataMap,
                                           WorkflowNodeEntity workflowNodeEntity, WorkflowDataPojo workflowDataPojo, WorkflowTransferPOJO workflowTransferPojo) throws XbbException;
}
